﻿using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using Swift;
using CB.Logic;
using DG.Tweening;
using ColorBlock = CB.Logic.ColorBlock;

namespace CB.Client
{
    public class ImageBlockIcon : BlockIcon<ImageBlock>
    {
        public override ImageBlock Block
        {
            get => block;
            set
            {
                block = value;

                Icon.gameObject.SetActive(!block.IsEmpty);
            }
        }
        private ImageBlock block;

        public override void SetData(ImageBlock block)
        {
            Block = block;
        }

        public void SetSprite(Sprite sprite)
        {
            Icon.sprite = sprite;
        }

        public void ShowImage()
        {
            Icon.gameObject.SetActive(true);
        }
    }
}